//
//  JGNavButton.m
//  JGPicGridDemo
//
//  Created by mac on 15/10/29.
//  Copyright (c) 2015年 Free. All rights reserved.
//

#import "JGNavButton.h"

@implementation JGNavButton

-(void)setFrame:(CGRect)frame
{
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        
        if ([self isLeftButton]) {
             frame.origin.x -= 16.0f;
        } else {
             frame.origin.x += 16.0f;
        }
    } else {
        if ([self isLeftButton])
        {
            frame.origin.x -= 5.0f;
        }
        else
        {
            frame.origin.x += 5.0f;
        }
    }
    
    [super setFrame:frame];
}

- (BOOL)isLeftButton
{
    return self.frame.origin.x < (self.superview.frame.size.width / 2);
}
@end
